﻿#pragma once

#include <string>
#include <vector>
#include "mxnet_mtcnn.hpp"

struct Facebox
{
	std::vector<cv::Mat>  aligned_faces;
	std::vector<face_box> face_boxs;
};

class FaceRecognizer {

public: 
	FaceRecognizer(std::string mtcnn_model, std::string insightface_params, std::string insightface_json);
	int LoadMxnetModel(const std::string & fname, std::vector<char>& buf);
	int LoadExtractModule(const std::string& param_file, const std::string& json_file, int batch, int channel, int input_h, int input_w);
	int loadModel(std::string mtcnn_model, std::string params, std::string json);
	//std::vector<cv::Mat> createAlignFace(cv::Mat& img,int type) {
	Facebox createAlignFace(cv::Mat& img, int type);
	cv::Mat extractFeature(const cv::Mat& face);
	double distance(const cv::Mat& base, const  cv::Mat& target);
	~FaceRecognizer();

private:
	PredictorHandle pred_feature;
	MxNetMtcnn mtcnn;

};
